<ion-view title="借入" hide-nav-bar="true">

	<ion-header-bar align-title="center" class="nav-bar-block" nav-bar="active">
	  <div class="buttons">
	    <button ng-click="backMy()" class="button back-button buttons button-clear header-item" style="color: black;">
			<i class="icon ion-ios-arrow-left"></i> 
  			<span class="back-text" style="transform: translate3d(0px, 0px, 0px);">
  				<span class="default-title">借入</span>
  			</span>
		</button>
	  </div>
	  <div class="button-bar">
		  <a ng-href="#/tab/my/borrowDuan" class="button" style="width: 50px;margin: 0 auto;margin-left: 10%;color: black;background-color: white;border:1px solid #888888;border-right:0px;font-size:14px;font-family: '微软雅黑';">短贷</a>
		  <a class="button" style="width: 80px;margin: 0 auto;margin-right: 10%;border: 1px solid #42bd55;background-color: white;color: #42bd55;font-size:14px;font-family: '微软雅黑';">长贷</a>
	  </div>
	  <div class="buttons">
	    <button class="button" style="background-color: white;" ng-click="toTip()">借不到钱?</button>
	  </div>
	</ion-header-bar>

	<ion-content delegate-handle="changScroll" style="background-color:#f5f5f5;">
		
		<style type="text/css">
		.item-avatar, .item-avatar .item-content, .item-avatar-left, .item-avatar-left .item-content{
			padding-left:0px;
		}
		
		.item-complex .item-content, .item-radio .item-content{
			padding:0px;
		}
		
		</style>
		
		<div style="width: 100%;height: 41px;font-size:16px;background-color: white;padding-top:10px;">
			<div class="button-bar" style="width: 330px;margin: 0 auto;" ng-if="borrowStatus==1">
			  <a style="text-align: center;width: 110px;color: #42bd55;border-bottom: 1px solid #42bd55;height: 31px;" ng-click="changeSel(1)">当前</a>
			  <a style="text-align: center;width: 110px;color: #888888;height: 31px;" ng-click="changeSel(2)">已还清</a>
			  <a style="text-align: center;width: 110px;color: #888888;height: 31px;" ng-click="changeSel(3)">逾期</a>
			</div>
			<div class="button-bar" style="width: 330px;margin: 0 auto;" ng-if="borrowStatus==2">
			  <a style="text-align: center;width: 110px;color: #888888;height: 31px;" ng-click="changeSel(1)">当前</a>
			  <a style="text-align: center;width: 110px;height: 31px;color: #42bd55;border-bottom: 1px solid #42bd55;" ng-click="changeSel(2)">已还清</a>
			  <a style="text-align: center;width: 110px;height: 31px;color: #888888;" ng-click="changeSel(3)">逾期</a>
			</div>
			<div class="button-bar" style="width: 330px;margin: 0 auto;" ng-if="borrowStatus==3">
			  <a style="text-align: center;width: 110px;color: #888888;height: 31px;" ng-click="changeSel(1)">当前</a>
			  <a style="text-align: center;width: 110px;height: 31px;color: #888888;" ng-click="changeSel(2)">已还清</a>
			  <a style="text-align: center;width: 110px;height: 31px;color: #42bd55;border-bottom: 1px solid #42bd55;" ng-click="changeSel(3)">逾期</a>
			</div>
		</div>

		<ion-list ng-if="borrowStatus==1">
	      <ion-item class="item-remove-animate item-avatar" ng-repeat="produce in currentProduceList" type="item-text-wrap" style="font-size: 13px;padding:0px;border-bottom:0px;margin-top:10px;">
	      	<!--当前未满标-->
	      	<a href="#/tab/my/payBackChang/{{produce.longProduceId}}/{{produce.status}}" ng-if="produce.status==1" style="color:black;">
	        	<div style="height: 143px;padding-left:10px;padding-right:10px;padding-top:10px;border-bottom: 1px solid #F5F5F5;">
		        	<div>
			        	<div style="height: 15px;font-size: 13px;padding-left:10px;border-left:2px solid blue;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;">已借入(元)</div>
			        	<div style="height: 15px;font-size: 13px;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;text-align: right;">

			        	</div>
			        	<div style="font-size: 40px;height: 40px;line-height: 40px;width: 50%;float: left;">{{produce.investAccount | number:2}}</div>
			        	<div style="float: left;width: 50%;height: 40px;line-height: 40px;text-align: right;color: #387ef5;">
			        		<div ng-if="produce.status==2">
				        		<span ng-if="produce.breakDays==0">今日还款</span>
				        		<span ng-if="produce.breakDays>0">还有{{produce.breakDays}}天还款</span>
			        		</div>
			        		<div ng-if="produce.status!=2">
				        		<span>待借：{{produce.totalPrice-produce.investAccount}}</span>
			        		</div>
			        	</div>
		        	</div>
		        	<div style="border-bottom: 1px solid #F8F8F8;height: 10px;clear: left;"></div>
		        	<div style="color:#888888;height: 40px;" ng-if="produce.status==2">
		        		<div style="width: 50%;float:left;height: 30px;line-height: 30px;">
			        		<div>当期应还&nbsp;{{produce.payBackMoney | number:2}}元</div>
			        		<div>利率&nbsp;{{produce.interestRates*100 | number:0}}%</div>
		        		</div>
		        		<div style="width: 50%;float:left;text-align: right;height: 30px;line-height: 30px;">
			        		<div>发布日&nbsp;{{produce.createTime| date:'yyyy-MM-dd'}}</div>
			        		<div>还款日&nbsp;{{produce.payBackTime| date:'yyyy-MM-dd'}}</div>
		        		</div>
		        	</div>
		        	<div style="color:#888888;height: 40px;" ng-if="produce.status!=2">
		        		<div style="width: 50%;float:left;height: 30px;line-height: 30px;">
			        		<div>分几期：&nbsp;{{produce.period}}期</div>
			        		<div>利率&nbsp;{{produce.interestRates*100 | number:0}}%</div>
		        		</div>
		        		<div style="width: 50%;float:left;text-align: right;height: 30px;line-height: 30px;">
			        		<div>状态：未满标</div>
			        		<div>发布日&nbsp;{{produce.createTime| date:'yyyy-MM-dd'}}</div>
		        		</div>
		        	</div>
	        	</div>
	        </a>
	        <!--当前已满标-->
	        <a href="#/tab/my/instalmentList/{{produce.longProduceId}}/1" ng-if="produce.status==2" style="color:black;">
	        	<div style="height: 143px;padding-left:10px;padding-right:10px;padding-top:10px;border-bottom: 1px solid #F5F5F5;">
		        	<div>
			        	<div style="height: 15px;font-size: 13px;padding-left:10px;border-left:2px solid blue;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;">已借入(元)</div>
			        	<div style="height: 15px;font-size: 13px;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;text-align: right;">

			        	</div>
			        	<div style="font-size: 40px;height: 40px;line-height: 40px;width: 50%;float: left;">{{produce.investAccount | number:2}}</div>
			        	<div style="float: left;width: 50%;height: 40px;line-height: 40px;text-align: right;color: #387ef5;">
			        		<div ng-if="produce.status==2">
				        		<span ng-if="produce.breakDays==0">今日还款</span>
				        		<span ng-if="produce.breakDays>0">还有{{produce.breakDays}}天还款</span>
			        		</div>
			        		<div ng-if="produce.status!=2">
				        		<span>待借：{{produce.totalPrice-produce.investAccount}}</span>
			        		</div>
			        	</div>
		        	</div>
		        	<div style="border-bottom: 1px solid #F8F8F8;height: 10px;clear: left;"></div>
		        	<div style="color:#888888;height: 40px;" ng-if="produce.status==2">
		        		<div style="width: 50%;float:left;height: 30px;line-height: 30px;">
			        		<div>当期应还&nbsp;{{produce.payBackMoney | number:2}}元</div>
			        		<div>利率&nbsp;{{produce.interestRates*100 | number:0}}%</div>
		        		</div>
		        		<div style="width: 50%;float:left;text-align: right;height: 30px;line-height: 30px;">
			        		<div>发布日&nbsp;{{produce.createTime| date:'yyyy-MM-dd'}}</div>
			        		<div>还款日&nbsp;{{produce.payBackTime| date:'yyyy-MM-dd'}}</div>
		        		</div>
		        	</div>
		        	<div style="color:#888888;height: 40px;" ng-if="produce.status!=2">
		        		<div style="width: 50%;float:left;height: 30px;line-height: 30px;">
			        		<div>分几期：&nbsp;{{produce.period}}期</div>
			        		<div>利率&nbsp;{{produce.interestRates*100 | number:0}}%</div>
		        		</div>
		        		<div style="width: 50%;float:left;text-align: right;height: 30px;line-height: 30px;">
			        		<div>状态：未满标</div>
			        		<div>发布日&nbsp;{{produce.createTime| date:'yyyy-MM-dd'}}</div>
		        		</div>
		        	</div>
	        	</div>
	        </a>
	      </ion-item>
	      <div style="width: 100%;">
				<div ng-if="cNoData" style="background-image: url(img/zw.png);background-repeat: no-repeat;width: 150px;height: 181px;background-position: center;margin: 0 auto;margin-top:50px ;">
					&nbsp;
				</div>
		  </div>
	      <ion-infinite-scroll ng-if="cNoMore" on-infinite="loadCurrentProduceList()" distance="20%"></ion-infinite-scroll>
	    </ion-list>
	    
	    <ion-list ng-if="borrowStatus==2">
	      <ion-item class="item-remove-animate item-avatar" ng-repeat="produce in allReadyProduceList" href="#/tab/my/instalmentList/{{produce.longProduceId}}/2" type="item-text-wrap" style="font-size: 13px;padding: 0px;border-bottom:0px;margin-top:10px;">
	        	<div style="height: 143px;padding-left:10px;padding-right:10px;padding-top:10px;border-bottom: 1px solid #F5F5F5;">
		        	<div>
			        	<div style="height: 15px;font-size: 13px;padding-left:10px;border-left:2px solid blue;line-height: 15px;margin-bottom: 10px;color:#888888;">已借(元)</div>
			        	<div style="font-size: 40px;height: 40px;line-height: 40px;">{{produce.investAccount | number:2}}</div>
		        	</div>
		        	<div style="border-bottom: 1px solid #F8F8F8;height: 10px;clear: left;"></div>
		        	<div style="color:#888888;">
		        		<div style="width: 50%;float:left;height: 40px;line-height: 30px;">
			        		<div>分几期&nbsp;{{produce.period}}期</div>
			        		<div>利率&nbsp;{{produce.interestRates*100 | number:0}}%</div>
		        		</div>
		        		<div style="width: 50%;float:left;text-align: right;height: 40px;line-height: 30px;">
			        		<div>发布日&nbsp;{{produce.createTime | date:'yyyy-MM-dd'}}</div>
			        		<div>还款日&nbsp;{{produce.payBackTime | date:'yyyy-MM-dd'}}</div>
		        		</div>
		        	</div>
	        	</div>
	      </ion-item>
	      <div style="width: 100%;">
				<div ng-if="aNoData" style="background-image: url(img/zw.png);background-repeat: no-repeat;width: 150px;height: 181px;background-position: center;margin: 0 auto;margin-top:50px ;">
					&nbsp;
				</div>
		  </div>
	      <ion-infinite-scroll ng-if="aNoMore" on-infinite="loadAllReadyProduceList()" distance="20%"></ion-infinite-scroll>
	    </ion-list>
	    
	    <ion-list ng-if="borrowStatus==3">
	      <ion-item class="item-remove-animate item-avatar" ng-repeat="produce in breakProduceList"  href="#/tab/my/instalmentList/{{produce.longProduceId}}/3" type="item-text-wrap" href="#/tab/borrow/{{produce.produceId}}/3" style="font-size: 13px;padding: 0px;border-bottom:0px;margin-top:10px;">
	        	<div style="height: 143px;padding-left:10px;padding-right:10px;padding-top:10px;border-bottom: 1px solid #F5F5F5;">
		        	<div>
			        	<div style="height: 15px;font-size: 13px;padding-left:10px;border-left:2px solid blue;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;">已借(元)</div>
			        	<div style="height: 15px;font-size: 13px;line-height: 15px;margin-bottom: 10px;color:#888888;width:50%;float: left;text-align: right;color:red;"></div>
			        	<div style="font-size: 40px;height: 40px;line-height: 40px;width: 50%;float: left;">{{produce.investAccount | number:2}}</div>
			        	<div style="float: left;width: 50%;height: 40px;line-height: 40px;text-align: right;" ><span style="color: red;">逾期 {{produce.breakDays-1}} 天</span></div>
		        	</div>
		        	<div style="border-bottom: 1px solid #F8F8F8;height: 10px;clear: left;"></div>
		        	<div style="color:#888888;">
		        		<div style="width: 50%;float:left;height: 40px;line-height: 30px;">
			        		<div>分几期:&nbsp;{{produce.period}}期</div>
			        		<div>利率:&nbsp;{{produce.interestRates*100 | number:0}}%</div>
		        		</div>
		        		<div style="width: 50%;float:left;text-align: right;height: 40px;line-height: 30px;">
			        		<div>发布日:&nbsp;{{produce.createTime | date:'yyyy-MM-dd'}}</div>
			        		<div>当期还款日:&nbsp;{{produce.payBackTime | date:'yyyy-MM-dd'}}</div>
		        		</div>
		        	</div>
	        	</div>
	      </ion-item>
	      <div style="width: 100%;">
				<div ng-if="bNoData" style="background-image: url(img/zw.png);background-repeat: no-repeat;width: 150px;height: 181px;background-position: center;margin: 0 auto;margin-top:50px ;">
					&nbsp;
				</div>
		  </div>
	      <ion-infinite-scroll ng-if="bNoMore" on-infinite="loadBreakProduceList()" distance="20%"></ion-infinite-scroll>
	    </ion-list>
		
	</ion-content>
</ion-view>